home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 150 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. From: John Max Skaller <maxtal@suphys.physics.su.oz.au>
  2. Message-ID: <31090045.26D7@suphys.physics.su.oz.au>
  3. X-Original-Date: Sat, 27 Jan 1996 02:24:37 +1000
  4. Path: in2.uu.net!bounce-back
  5. Date: 26 Jan 96 19:23:01 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Why no allocator-specific delete?
  9. Organization: MAXTAL
  10. References: <4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM> <4e85k6$b04@noc.tor.hookup.net>
  11. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMQkqIOEDnX0m9pzZAQEyhgF7B/We4ho5rd4Wv+ukxknBOi3s503mSloz
  14.     QmO86xTGcZcm/oHk37+stVMbhR6s6ds4
  15.     =vFgN
  16.  
  17. Matt Timmermans wrote:
  18. > Yes, and this is very annoying.  The lack of a placement-delete makes
  19. > placement-new nearly useless.  I can't, in fact, think of a single way that
  20. > placement-new could be used properly.
  21. > The lack of a placement-delete is on of the many factors in C++ conspiring
  22. > to make it absolutely impossible to make generic collections that hold
  23. > actual objects (with constructors) instead of just pointers.
  24.  
  25. With all due repsect please examine STL carefully.
  26.  
  27. Who needs "delete"? With STL, deallocation of storage
  28. and destruction of an object are separable.
  29. If you don't like "delete", just don't use it.
  30.  
  31. The same applies to "new" -- the ONLY form of
  32. new that is necessary is the standard placement form,
  33. because that is the way to create an object in a 
  34. specified storage location. So that, too, allows
  35. separation of construction and allocation.
  36.  
  37. With your own deallocation functions, you can
  38. do whatever overloading you want. So what is the problem?
  39.  
  40. -- 
  41. John Max Skaller               voice: 61-2-566-2189
  42. 81 Glebe Point Rd              fax:   61-2-660-0850
  43. GLEBE NSW 2037                 web: http://www.maxtal.com.au/~skaller/
  44. AUSTRALIA                      email: skaller@maxtal.com.au
  45. ---
  46. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  47.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  48.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  49.